07. Flat Files in Python
Flat Files in Python
Flat Files in Python
pandas has one main function for parsing flat files and it is
read_csv
. Here is a link to its
documentation
.
Quiz
In the Jupyter Notebook below, import the Rotten Tomatoes Top 100 Movies of All Time TSV file ('bestofrt.tsv') into a pandas DataFrame. *Hint: read up on the *sep* parameter in the
read_csv
documentation.*
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: jupyter
- Opened files (when workspace is loaded): n/a
Quiz: Importing Flat Files
QUESTION:
Get your code working in the Jupyter Notebook above, then copy and paste the
read_csv
statement to import the TSV file into a pandas DataFrame, starting with
df =
.
SOLUTION:
NOTE: The solutions are expressed in RegEx pattern. Udacity uses these patterns to check the given answer
Flat Files in Python